home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2000 March / maximum-cd-2000-03.iso / Quake3 Game Source / Q3AGameSource.exe / Main / be_aas.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-18  |  6.0 KB  |  166 lines

  1. // Copyright (C) 1999-2000 Id Software, Inc.
  2. //
  3.  
  4. /*****************************************************************************
  5.  * name:        be_aas.h
  6.  *
  7.  * desc:        Area Awareness System, stuff exported to the AI
  8.  *
  9.  * $Archive: /source/code/botlib/be_aas.h $
  10.  * $Author: Mrelusive $ 
  11.  * $Revision: 2 $
  12.  * $Modtime: 10/05/99 3:32p $
  13.  * $Date: 10/05/99 3:42p $
  14.  *
  15.  *****************************************************************************/
  16.  
  17. #ifndef MAX_STRINGFIELD
  18. #define MAX_STRINGFIELD                80
  19. #endif
  20.  
  21. //travel flags
  22. #define TFL_INVALID                0x0000001    //traveling temporary not possible
  23. #define TFL_WALK                0x0000002    //walking
  24. #define TFL_CROUCH                0x0000004    //crouching
  25. #define TFL_BARRIERJUMP            0x0000008    //jumping onto a barrier
  26. #define TFL_JUMP                0x0000010    //jumping
  27. #define TFL_LADDER                0x0000020    //climbing a ladder
  28. #define TFL_WALKOFFLEDGE        0x0000080    //walking of a ledge
  29. #define TFL_SWIM                0x0000100    //swimming
  30. #define TFL_WATERJUMP            0x0000200    //jumping out of the water
  31. #define TFL_TELEPORT            0x0000400    //teleporting
  32. #define TFL_ELEVATOR            0x0000800    //elevator
  33. #define TFL_ROCKETJUMP            0x0001000    //rocket jumping
  34. #define TFL_BFGJUMP                0x0002000    //bfg jumping
  35. #define TFL_GRAPPLEHOOK            0x0004000    //grappling hook
  36. #define TFL_DOUBLEJUMP            0x0008000    //double jump
  37. #define TFL_RAMPJUMP            0x0010000    //ramp jump
  38. #define TFL_STRAFEJUMP            0x0020000    //strafe jump
  39. #define TFL_JUMPPAD                0x0040000    //jump pad
  40. #define TFL_AIR                    0x0080000    //travel through air
  41. #define TFL_WATER                0x0100000    //travel through water
  42. #define TFL_SLIME                0x0200000    //travel through slime
  43. #define TFL_LAVA                0x0400000    //travel through lava
  44. #define TFL_DONOTENTER            0x0800000    //travel through donotenter area
  45. #define TFL_FUNCBOB                0x1000000    //func bobbing
  46. #define TFL_FLIGHT                0x2000000    //flight
  47.  
  48. //default travel flags
  49. #define TFL_DEFAULT    TFL_WALK|TFL_CROUCH|TFL_BARRIERJUMP|\
  50.     TFL_JUMP|TFL_LADDER|\
  51.     TFL_WALKOFFLEDGE|TFL_SWIM|TFL_WATERJUMP|\
  52.     TFL_TELEPORT|TFL_ELEVATOR|\
  53.     TFL_AIR|TFL_WATER|TFL_JUMPPAD|TFL_FUNCBOB
  54.  
  55. typedef enum
  56. {
  57.     SOLID_NOT,            // no interaction with other objects
  58.     SOLID_TRIGGER,        // only touch when inside, after moving
  59.     SOLID_BBOX,            // touch on edge
  60.     SOLID_BSP            // bsp clip, touch on edge
  61. } solid_t;
  62.  
  63. //a trace is returned when a box is swept through the AAS world
  64. typedef struct aas_trace_s
  65. {
  66.     qboolean    startsolid;    // if true, the initial point was in a solid area
  67.     float        fraction;    // time completed, 1.0 = didn't hit anything
  68.     vec3_t        endpos;        // final position
  69.     int            ent;        // entity blocking the trace
  70.     int            lastarea;    // last area the trace was in (zero if none)
  71.     int            area;        // area blocking the trace (zero if none)
  72.     int            planenum;    // number of the plane that was hit
  73. } aas_trace_t;
  74.  
  75. /* Defined in botlib.h
  76.  
  77. //bsp_trace_t hit surface
  78. typedef struct bsp_surface_s
  79. {
  80.     char name[16];
  81.     int flags;
  82.     int value;
  83. } bsp_surface_t;
  84.  
  85. //a trace is returned when a box is swept through the BSP world
  86. typedef struct bsp_trace_s
  87. {
  88.     qboolean        allsolid;    // if true, plane is not valid
  89.     qboolean        startsolid;    // if true, the initial point was in a solid area
  90.     float            fraction;    // time completed, 1.0 = didn't hit anything
  91.     vec3_t            endpos;        // final position
  92.     cplane_t        plane;        // surface normal at impact
  93.     float            exp_dist;    // expanded plane distance
  94.     int                sidenum;    // number of the brush side hit
  95.     bsp_surface_t    surface;    // hit surface
  96.     int                contents;    // contents on other side of surface hit
  97.     int                ent;        // number of entity hit
  98. } bsp_trace_t;
  99. //*/
  100.  
  101. //entity info
  102. typedef struct aas_entityinfo_s
  103. {
  104.     int        valid;            // true if updated this frame
  105.     int        type;            // entity type
  106.     int        flags;            // entity flags
  107.     float    ltime;            // local time
  108.     float    update_time;    // time between last and current update
  109.     int        number;            // number of the entity
  110.     vec3_t    origin;            // origin of the entity
  111.     vec3_t    angles;            // angles of the model
  112.     vec3_t    old_origin;        // for lerping
  113.     vec3_t    lastvisorigin;    // last visible origin
  114.     vec3_t    mins;            // bounding box minimums
  115.     vec3_t    maxs;            // bounding box maximums
  116.     int        groundent;        // ground entity
  117.     int        solid;            // solid type
  118.     int        modelindex;        // model used
  119.     int        modelindex2;    // weapons, CTF flags, etc
  120.     int        frame;            // model frame number
  121.     int        event;            // impulse events -- muzzle flashes, footsteps, etc
  122.     int        eventParm;        // even parameter
  123.     int        powerups;        // bit flags
  124.     int        weapon;            // determines weapon and flash model, etc
  125.     int        legsAnim;        // mask off ANIM_TOGGLEBIT
  126.     int        torsoAnim;        // mask off ANIM_TOGGLEBIT
  127. } aas_entityinfo_t;
  128.  
  129.  
  130. //client movement prediction stop events, stop as soon as:
  131. #define SE_NONE                    0
  132. #define SE_HITGROUND            1        // the ground is hit
  133. #define SE_LEAVEGROUND            2        // there's no ground
  134. #define SE_ENTERWATER            4        // water is entered
  135. #define SE_ENTERSLIME            8        // slime is entered
  136. #define SE_ENTERLAVA            16        // lava is entered
  137. #define SE_HITGROUNDDAMAGE        32        // the ground is hit with damage
  138. #define SE_GAP                    64        // there's a gap
  139. #define SE_TOUCHJUMPPAD            128        // touching a jump pad area
  140. #define SE_TOUCHTELEPORTER        256        // touching teleporter
  141. #define SE_ENTERAREA            512        // the given stoparea is entered
  142. #define SE_HITGROUNDAREA        1024    // a ground face in the area is hit
  143. #define SE_HITBOUNDINGBOX        2048    // hit the specified bounding box
  144.  
  145. typedef struct aas_clientmove_s
  146. {
  147.     vec3_t endpos;            //position at the end of movement prediction
  148.     int endarea;            //area at end of movement prediction
  149.     vec3_t velocity;        //velocity at the end of movement prediction
  150.     aas_trace_t trace;        //last trace
  151.     int presencetype;        //presence type at end of movement prediction
  152.     int stopevent;            //event that made the prediction stop
  153.     float endcontents;        //contents at the end of movement prediction
  154.     float time;                //time predicted ahead
  155.     int frames;                //number of frames predicted ahead
  156. } aas_clientmove_t;
  157.  
  158. typedef struct aas_altroutegoal_s
  159. {
  160.     vec3_t origin;
  161.     int areanum;
  162.     unsigned short starttraveltime;
  163.     unsigned short goaltraveltime;
  164.     unsigned short extratraveltime;
  165. } aas_altroutegoal_t;
  166.